﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="HealthManagementTemplate.ProfilePage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:HealthManagementTemplate"
    xmlns:common="using:HealthManagementTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Background="#778899">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="Created Profile" Style="{StaticResource PageHeaderTextStyle}" Foreground="White"/>
        </Grid>

        <ScrollViewer x:Name="MainScroll" Grid.Row="1" Style="{StaticResource HorizontalScrollViewerStyle}">
            <Grid Height="541" Width="1004" HorizontalAlignment="Left" Margin="120,0,0,0" VerticalAlignment="Top">
                <Grid HorizontalAlignment="Left" Height="541" Margin="0" VerticalAlignment="Top" Width="661" Background="#FF0C9DE6">
                    <Rectangle Margin="1,2,0,0" Fill="White" Width="158" Height="158"  HorizontalAlignment="Left" VerticalAlignment="Top"/>
                    <Image Margin="14,0,0,160" Source="images/write.png" Stretch="Fill" Width="46" Height="46" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                    <Image Margin="75,0,0,160" Source="images/recycle.png" Stretch="Fill" Width="46" Height="46" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                    <TextBlock HorizontalAlignment="Left" Margin="165,68,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="53.333" FontFamily="Segoe UI" LineHeight="32" FontWeight="Thin">
        				<Run FontSize="24" Text="Hello"/>
        				<LineBreak/>
        				<Run Text="Name"/>
                    </TextBlock>
                    <StackPanel HorizontalAlignment="Left" Height="265" Margin="160,180,0,0" VerticalAlignment="Top" Width="499">
                        <Grid HorizontalAlignment="Left" Height="49" VerticalAlignment="Top" Width="501" Background="#66D4D3D3" Margin="0,0,-2,0">
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="10,0,0,0" TextWrapping="Wrap" Text="Textblock 1" VerticalAlignment="Top" Width="97" FontSize="21.333" Padding="0,15,0,0" FontWeight="Thin"/>
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="95,0,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="404" FontFamily="Segoe UI" FontSize="30.667" Padding="0,5,0,0" FontWeight="Thin"/>
                        </Grid>
                        <Grid HorizontalAlignment="Left" Height="49" VerticalAlignment="Top" Width="501" Background="#66D4D3D3" Margin="0,5,-2,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="125*"/>
                                <ColumnDefinition Width="376*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="10,0,0,0" TextWrapping="Wrap" Text="Textblock 2" VerticalAlignment="Top" Width="130" FontSize="21.333" Padding="0,15,0,0" FontWeight="Thin"/>
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="95,0,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="404" FontFamily="Segoe UI" FontSize="30.667" Padding="0,4,0,0" FontWeight="Thin" Grid.ColumnSpan="2"/>
                        </Grid>
                        <Grid HorizontalAlignment="Left" Height="49" VerticalAlignment="Top" Width="501" Background="#66D4D3D3" Margin="0,5,-2,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="34*"/>
                                <ColumnDefinition Width="152*"/>
                                <ColumnDefinition Width="315*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="10,0,0,0" TextWrapping="Wrap" Text="Textblock 3" VerticalAlignment="Top" Width="130" FontSize="21.333" Padding="0,15,0,0" FontWeight="Thin" Grid.ColumnSpan="2"/>
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="95,0,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="372" FontFamily="Segoe UI" FontSize="30.667" Padding="0,5,0,0" FontWeight="Thin" Grid.ColumnSpan="2" Grid.Column="1"/>
                        </Grid>
                        <Grid HorizontalAlignment="Left" Height="49" VerticalAlignment="Top" Width="501" Background="#66D4D3D3" Margin="0,5,-2,0">
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="10,0,0,0" TextWrapping="Wrap" Text="Textblock 4" VerticalAlignment="Top" Width="130" FontSize="21.333" Padding="0,15,0,0" FontWeight="Thin" FontFamily="Segoe UI"/>
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="95,0,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="404" FontFamily="Segoe UI" FontSize="30.667" Padding="0,5,0,0" FontWeight="Thin"/>
                        </Grid>
                        <Grid HorizontalAlignment="Left" Height="49" VerticalAlignment="Top" Width="501" Background="#66D4D3D3" Margin="0,5,-2,0">
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="10,0,0,0" TextWrapping="Wrap" Text="Textblock 5" VerticalAlignment="Top" Width="130" FontSize="21.333" Padding="0,15,0,0" FontWeight="Thin" FontFamily="Segoe UI"/>
                            <TextBlock HorizontalAlignment="Left" Height="49" Margin="95,0,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="404" FontFamily="Segoe UI" FontSize="30.667" Padding="0,5,0,0" FontWeight="Thin"/>
                        </Grid>
                    </StackPanel>
                </Grid>
                <Grid HorizontalAlignment="Right" Height="540" Margin="0" VerticalAlignment="Top" Width="299">
                    <GridViewItem x:Name="Medication" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Width="142" Height="123" Tapped="Medication_Tapped">
                        <Image Source="images/Lab Reports-01.png" Stretch="Fill"/>
                    </GridViewItem>
                    <GridViewItem x:Name="Reminder" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Top" Width="142" Height="123">
                        <Image Source="images/Consultation-01.png" Stretch="Fill"/>
                    </GridViewItem>
                    <GridViewItem x:Name="Tracker" HorizontalAlignment="Left" Margin="0,135,0,0" VerticalAlignment="Top" Width="142" Height="123">
                        <Image Source="images/HealthRecords-01.png" Stretch="Fill"/>
                    </GridViewItem>
                    <GridViewItem x:Name="Med" HorizontalAlignment="Right" Margin="0,135,0,0" VerticalAlignment="Top" Width="142" Height="123">
                        <Image Source="images/Medication-01.png" Stretch="Fill"/>
                    </GridViewItem>
                    <GridViewItem x:Name="Exercise" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Bottom" Width="142" Height="123">
                        <Image Source="images/AddPeople-01.png" Stretch="Fill"/>
                    </GridViewItem>
                    <GridViewItem x:Name="Diet" HorizontalAlignment="Left" Margin="0,0,0,140" VerticalAlignment="Bottom" Width="142" Height="123">
                        <Image Source="images/PreviousHistory-01.png" Stretch="Fill"/>
                    </GridViewItem>
                    <GridViewItem x:Name="Addpeople" HorizontalAlignment="Right" Margin="0,0,0,140" VerticalAlignment="Bottom" Width="142" Height="123">
                        <Image Source="images/OPVisit-01.png" Stretch="Fill"/>
                    </GridViewItem>
                    <GridViewItem x:Name="AddMorepeople" HorizontalAlignment="Right" Margin="0,140,0,0" VerticalAlignment="Bottom" Width="142" Height="123" Tapped="Addpeople_Tapped">
                        <Image Source="images/OtherProfile-01.png" Stretch="Fill"/>
                    </GridViewItem>
                </Grid>
            </Grid>
        </ScrollViewer>

        <Grid x:Name="gridSnap" Visibility="Collapsed" Grid.Row="1">
            <StackPanel Margin="15,0,20,20" Orientation="Vertical" d:LayoutOverrides="Height">

                <TextBlock Foreground="#ffffff" TextWrapping="Wrap" FontSize="22" Margin="0,200,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="SemiBold" >
                    <Run Text="Please switch to full screen to view the details."/>
                    <LineBreak/>
                    <Run/>
                    <LineBreak/>
                    <Run Text="" />
                    <LineBreak/>
                    <Run/>
                    <LineBreak/>
                    <LineBreak/>
                    <Run/>
                    <LineBreak/>
                </TextBlock>
            </StackPanel>
            <Image Margin="0,495,0,0" Source="Assets/Images/bg.jpg" Stretch="Fill"/>
        </Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup>
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>

                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="gridSnap" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>

                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainScroll" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
    
</common:LayoutAwarePage>
